package com.jing21.learn.fs.client;

import com.aliyuncs.sts.model.v20150401.AssumeRoleResponse;
import com.jing21.learn.fs.FsConstants;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Sts
 * Create By zhengjing on 2017/11/16 09:46
 */
@FeignClient(FsConstants.SERVICE_NAME)
@RequestMapping("/sts")
public interface StsClient extends FsConstants {

    /**
     * 获取用户权限 jing21-static:/user/#{username}/
     *
     * @param principal
     * @return
     */
    @RequestMapping(value = "/credentials", method = RequestMethod.GET)
    AssumeRoleResponse.Credentials getUserCredentials(String username);
}
